<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
class Hotel_order_mdl extends CI_Model
{
	public function __construct()
	{
		parent::__construct();
	}
	
	public function add_hotel_order($p_arrAdd) 
	{
	
		$arrTpl = array(	'room_type'	 	=> 0, 	 	
							'hotel_name'	=> 0,	 	 	 	 	 	 	
							'room_nums'	 	=> 0, 	 	 	 	 	
							'user_name'	 	=> 0, 	 	 	 	
							'user_tel'	    => 0,	 	 	 	 	
							'user_card'	 	=> 0, 	 	 	 	
							'room_price'	=> 0, 	
							'in_time' 	    => 0,	
							'out_time'	 	=> 0, 	 	
							'advance_time' 	=> 0, 	 	 	
							'late_time'	    => 0,	 	 	 	 	 	
							'remark'        => 0,
							);
							
							
	   $strSql = "INSERT INTO dili_u_m_hotel_order(
	   									
									    room_type ,
									    hotel_name,
									    room_nums,
										user_name,
	   									user_tel,
	   									user_card,
	   									room_price,
	   									in_time,
	   									out_time,
									   advance_time,
									   late_time,
									   remark	 	   		
	   						  ) 
							  VALUES( 
							".$p_arrAdd["room_type"]."	 	,
							'".$p_arrAdd["hotel_name"]."'	,
							".$p_arrAdd["room_nums"]."		,
							'".$p_arrAdd["user_name"]."'	,	
							'".$p_arrAdd["user_tel"]."'		,
							'".$p_arrAdd["user_card"]."'	,		
							".$p_arrAdd["room_price"]."		,
	   						'".$p_arrAdd["in_time"]."'		,
							'".$p_arrAdd["out_time"]."'		,
							'".$p_arrAdd["advance_time"]."'	,
							'".$p_arrAdd["late_time"]."'	,
							'".$p_arrAdd["remark"]."'										
							  )";

  
   
							
    $this->db->query($strSql);
	return $this->db->insert_id();
	}
	
	
	public function get_hotel_order($p_id)
	{
		$sql = "select room_type,room_price,room_nums,in_time,out_time from dili_u_m_hotel_order where id = $p_id";
		
		return $this->db->query($sql)->result_array();
		
	}
}
